package com.zhiyou.books.service.impl;

import com.zhiyou.books.dao.BookDao;
import com.zhiyou.books.pojo.Book;
import com.zhiyou.books.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookDao bookDao;
    @Override
    public List<Book> getAllBooks() {
        return bookDao.selectAll();
    }

    @Transactional
    @Override
    public List<Book> getBookById(int id) {
        return bookDao.getBookById(id);
    }
}
